Skip to content

feat(pricing): add GET /price/:asset/fiat for local currency conversion and naira valuation (#290) - #529

Merged
Miracle656 merged 1 commit into
Divinity-Labs:mainfrom
sparkysolutions10-pixel:feat/fiat-pricing-naira-290
Oct 22, 2026
Merged

Miracle656 merged 1 commit into
Divinity-Labs:mainfrom
sparkysolutions10-pixel:feat/fiat-pricing-naira-290

Conversation

@sparkysolutions10-pixel

Copy link
Copy Markdown
Contributor

Closes #290

Summary of Changes

  • Implements GET /price/:asset/fiat endpoint enabling valuation of Stellar assets in real-world fiat currencies.
  • First-class support for Nigerian Naira (NGN) as well as USD, EUR, GBP, KES, ZAR, CAD, and BRL.
  • Computes deterministic cross-rates (asset -> USD -> target_fiat) with fallback safety and timestamp tracking.
  • Validates target currency and returns HTTP 400 with the list of supported fiat codes for invalid requests.
  • Fully registered in openapi.yaml and verified with automated unit tests in src/__tests__/fiat.test.ts.

@Miracle656
Miracle656 merged commit 57ee361 into Divinity-Labs:main Oct 22, 2026
1 check passed
Miracle656 added a commit that referenced this pull request Oct 22, 2026
  tsc --noEmit   clean
  vitest         99 files, 1140 passing (up from 97 / 1135)
  dropped-tests  none

  #280  close the vulnerabilities that are actually reachable
  #426  keep watched pairs as metric labels, bounded
  #529  GET /price/:asset/fiat for local currency
  #530  standard 429 response contract with retryAfter

#530 pairs well with what landed earlier: #307 standardised empty-vs-missing
status codes, and this does the same for rate limiting. An API that answers
429 without telling a client when to come back forces every consumer to invent
its own backoff, and they will not agree.

#461 (generate TypeScript and Python route snippets from the OpenAPI spec) was
dropped. It fails three of its own tests even after running `npm run
snippets:gen`:

  × render deterministically
  × committed files match the generator
  × contain no placeholder hosts or addresses

The regeneration produced no files at all, so the generator is not doing what
the test expects of it. The third case is the one I care about most -- a
snippet carrying a placeholder address is exactly how an invented contract id
reaches a contributor, which has already cost us a sweep. Worth getting right
rather than merging around.

Claude-Session: https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No route answers what an asset is worth in naira

2 participants